package fr.ants.view;

/**
 * to know the state about the renderer.
 * 
 * @author Guillaume
 * 
 */
public enum Renderer {

	/**
	 * to show something in the map.
	 */
	POKEMON("Pokemon"),
	/**
	 * to draw a obstacle.
	 */
	RELIEF("Relief"),
	/**
	 * to draw a obstacle.
	 */
	GRIS("Niveaux de Gris");
	
	/**
	 * label for a field.
	 */
	private final String label;
	
	/**
	 * Constructor of the {@link FieldsTree}.
	 * 
	 * @param label
	 *            label of the icon
	 */
	
	private Renderer(final String label) {
		
		this.label = label;
		
	}

	public String getLabel() {
		return label;
	}
	
	/**
	 * Search a Renderer by its type.
	 * 
	 * @param type
	 *            
	 * @return rendererFound {@link Renderer}
	 */
	public static Renderer getRendererType(String type) {
		Renderer rendererFound = null;
		for (Renderer ren : Renderer.values()) {
			if (ren.getLabel().equals(type)) {
				rendererFound = ren;
			}
		}
		return rendererFound;
	}
}


